import random
import json

"""生成测试数据集：随机大小和随机数的列表"""


def generate_data(cases=5, size_range=(10, 50)):
    data = {}
    for i in range(cases):
        size = random.randint(*size_range)
        data[f"case_{i+1}"] = {
            "original": [random.randint(-100, 100) for _ in range(size)],
            "expected": None,  # 由alg.py填充
        }
    return data


if __name__ == "__main__":
    dataset = generate_data()
    # 保存数据集
    with open("test_cases.json", "w") as f:
        json.dump(dataset, f, indent=2)
    print("测试数据已生成到 test_cases.json")
